<form id="pagerForm" method="post" action="">
	<input type="hidden" name="pageNum" value="{$pageNum}" />
	<input type="hidden" name="numPerPage" value="{$numPerPage}" />
	<input type="hidden" name="orderField" value="{$orderField}" />
	<input type="hidden" name="orderDirection" value="{$orderDirection}" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="" method="post">
		<input type="hidden" name="g" value="{$group_name}" />
		<input type="hidden" name="m" value="{$module_name}" />
		<input type="hidden" name="a" value="{$action_name}" />
	<div class="searchBar">
		
		            <ul class="searchContent">
         
				<li>
					分类：
					<!--<select name='cateid'>
						<option value='3'{if $cateid == 3}selected{/if}>手机</option>
						<option value='70' {if $cateid == 70}selected{/if}>平板电脑</option>
						<option value='4' {if $cateid == 4}selected{/if}>手机配件</option>
						<option value='14' {if $cateid == 14}selected{/if}>手机饰品</option>
						<option value='186' {if $cateid == 186}selected{/if}>手机靓号</option>
					</select>
					-->
						<input id="inputcate1" name="cat.id"  value="{$cateid}"  type="hidden"/>
						<input class="required" name="cat.name" value="{$catname}" type="text" postField="keywords" suggestFields="id,name" suggestUrl="{:U('Content/suggest',array('tn'=>'product_category_tag','fn'=>'id,name'))}" lookupGroup="cat"/>
                        
				</li>
				
				
                <li style="padding-top:0;"><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
            </ul>
		
	</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><!--<a class="add" href="{:U('Attribute/add',array('type'=>'cat'))}" target="dialog" width="600" height="450"><span>添加</span></a>--></li>
			<li><a class="add" href="{:U('Attribute/addcatattr')}" target="dialog" width="600" height="450" rel='addcatattr'><span>批量添加</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids[]" href="{:U('Attribute/delattrcate')}" class="delete"><span>批量删除</span></a></li>
			<!--<li><a class="delete" href="{:U('Attribute/add',array('type'=>'cat'))}" ><span>删除</span></a></li>-->
		</ul>
	</div>
	<table class="table" width="1200" layoutH="113">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
				<th width="25" orderField="id" {if $orderField=='id'}class="{$orderDirection}"{/if}>ID</th>
				<th width="50" orderField="category_id" {if $orderField=='category_id'}class="{$orderDirection}"{/if}>分类</th>
				<th width="50" orderField="attr_id" {if $orderField=='attr_id'}class="{$orderDirection}"{/if}>属性名称</th>
				<th width="50" orderField="attr_id" {if $orderField=='attr_id'}class="{$orderDirection}"{/if}>属性别名</th>
				<th width="60" orderField="attr_id" {if $orderField=='attr_id'}class="{$orderDirection}"{/if}>属性值</th>
				<th width="60" orderField="sequence" {if $orderField=='sequence'}class="{$orderDirection}"{/if}>排序</th>
				<th width="60" orderField="sequence" >适用平台</th>			
				<th width="60" align="center">操作</th>
			</tr>
		</thead>
		
		<tbody>
		<volist name='list' id='b'>
			<tr target="sid_user">
				<td><input name="ids[]" value="{$b['id']}" type="checkbox" class="type"></td>
				<td>{$b['id']}</td>
				<td>{$b['catename']}</td>
				<td>{$b['attr']['name']}</td>
				<td>{$b['attr']['alias']}</td>
				<td>{$b['attr']['value']}</td>
				<td><input id="sequence{$b.id}" type='text' onblur="ajax_update({$b.id} , 'sequence')" value='{$b.sequence}' style='width:50px;' />
				</td>
				</td>
				
				<td>
				<select id="platform{$b.id}" onchange="ajax_update({$b.id} ,'platform')">
				<option value='SMW01' {if $b['platform'] == 'SMW01'} selected {/if}>云采购平台</option>	
				<option value="91YUNGOU" {if $b['platform'] == '91YUNGOU'} selected {/if}>云购平台</option>	
				<option value="ALL" {if $b['platform'] == 'ALL'} selected {/if}>所有平台</option>	
				</select>
					</td>	
								
				<td>
					<a target="ajaxTodo" class="btnDel" href="{:U('Attribute/delcatattr',array('id'=>$b['id']))}" title="确实要删除这条记录吗?">删除</a>
				</td>
			</tr>
		</volist>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="20" {if $numPerPage==20}selected="selected"{/if}>20</option>
				<option value="50" {if $numPerPage==50}selected="selected"{/if}>50</option>
				<option value="100" {if $numPerPage==100}selected="selected"{/if}>100</option>
				<option value="200" {if $numPerPage==200}selected="selected"{/if}>200</option>
			</select>
			<span>条，共{$totalCount}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="{$totalCount}" numPerPage="{$numPerPage}" pageNumShown="10" currentPage="{$pageNum}"></div>
	</div>
</div>
<script>
	
	//修改排序 和 适用平台
	function ajax_update(id,field){
		var value = $('#'+field+id).val();
		$.ajax({
			type: "POST",
			url: "{:U('Attribute/ajax_update')}",
			data: 'id='+id+'&field='+field+'&value='+value,
			dataType:'json',
			success: function(msg){
				if (msg == 1) {
					//alertMsg.info('修改成功！');
				}else{
					//alertMsg.info('修改私！');
				}
			}
		});
	}

</script>